// components/taskcell/taskcell.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    id: {
      type: Number,
      value: 0
    },
    name: {
      type: String,
      value: '待办事项'
    },
    tagList: {
      type: Array,
      value: ['1', '2']
    },
    isSelect: {
      type: Boolean,
      value: false
    },
    isShowDetail: {
      type: Boolean,
      value: false
    },
    detail: {
      type:String,
      value: ""
    },
    isShowRadio: {
      type:Boolean,
      value:true
    },
    isShowDelete: {
      type:Boolean,
      value:true
    }

  },

  /**
   * 组件的初始数据
   */
  data: {
    test:false,
    _showTagStr: '',
    _noInteractin:true,
    isShowPop:false
  },

  /*
  * 组件生命周期函数-在组件实例进入页面节点树时执行)
  */
  attached: function(){
    this.setData({
      _showTagStr: this.data.tagList.join('-')
    })
  },

  /**
   * 组件的方法列表
   */
  methods: {
    deleteMethod: function(){
      this.triggerEvent('deleteEvent', this.data.id);
    },
    seeDetail: function(){
      var bl = this.data.isShowPop;
      this.setData({
        isShowPop: !bl
      });
      // this.triggerEvent('seeDetail');
    },
    _changeSelectState: function(){
      var tempBool = this.data.isSelect;
      this.setData({
        isSelect: !tempBool,
      });
      this.triggerEvent('changeState', this.data.id);
    },
    _arrayJoin:function(){
      return this.data.tagList.join('-');
    }
  }
})
